package cn.creditease.std.producer.impl;

import cn.creditease.std.producer.Producer;
import cn.creditease.std.dao.JobDAO;
import cn.creditease.std.model.Job;
import java.util.List;
import org.springframework.util.CollectionUtils;

/**
 * @Description: 通过数据库查询做消费通道
 * @Author: kai.yang
 * @Date: 2019-08-07 10:49
 */
public class DbProducerImpl implements Producer {


    JobDAO jobDAO = JobDAO.newInstance();


    @Override
    public void send(List<Job> jobList) {
        if (!CollectionUtils.isEmpty(jobList)) {
            jobDAO.insertBatch(jobList);
        }
    }


    @Override
    public String getType() {
        return "db";
    }

    @Override
    public int getOrder() {
        return 0;
    }
}
